<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script type="text/javascript" src="script/jquery-3.7.1.min.js"></script>
  <script type="text/javascript">
    window.onload=function (){
      var username = document.getElementById("username");
      alert("dom的username "+username.value)

      var $username = $(username);
      alert("jquery的username "+$username.val())

      //jquery转成dom对象
      //jquery是个数组对象，封装了dom对象
      //可以通过[index]来获取
      //一般来说index是0
      // 方式一
      // var username = $username[0];
      //方式二
      var username = $username.get(0);
      alert("jquery转成dom对象的username "+username.value)

    }
  </script>
</head>
<body>
输入<input type="text" id="username" name="username"value="gzggzgz">
</body>
</html>